home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LTP_Delay.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  898b  |  40 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. VOID __regargs
  10. LTP_Delay(ULONG Seconds,ULONG Micros)
  11. {
  12.     struct MsgPort __aligned    TimePort;
  13.     struct timerequest __aligned    TimeRequest;
  14.  
  15.     memset(&TimePort,0,sizeof(TimePort));
  16.  
  17.     NewList(&TimePort . mp_MsgList);
  18.  
  19.     TimePort . mp_Flags    = PA_SIGNAL;
  20.     TimePort . mp_SigBit    = SIGB_SINGLE;
  21.     TimePort . mp_SigTask    = SysBase -> ThisTask;
  22.  
  23.     memset(&TimeRequest,0,sizeof(TimeRequest));
  24.  
  25.     TimeRequest . tr_node . io_Message . mn_ReplyPort = &TimePort;
  26.  
  27.     if(!OpenDevice(TIMERNAME,UNIT_VBLANK,&TimeRequest,NULL))
  28.     {
  29.         TimeRequest . tr_node . io_Command    = TR_ADDREQUEST;
  30.         TimeRequest . tr_time . tv_secs     = Seconds;
  31.         TimeRequest . tr_time . tv_micro    = Micros;
  32.  
  33.         SetSignal(0,SIGF_SINGLE);
  34.         SendIO(&TimeRequest);
  35.         WaitIO(&TimeRequest);
  36.  
  37.         CloseDevice(&TimeRequest);
  38.     }
  39. }
  40.